import { getAllvideo, getCloudMusic, getVedioUrl } from '@/utils/api'
import { defineStore } from 'pinia'
import { Vedio, VedioUrl } from '@/models/vedio'
import { AllVideo } from '@/models/mv'

export const vedio = defineStore('vedio', {
    state: () => {
        return {
            vedioDetail: {} as Vedio,
            allVedio: {} as AllVideo,
            vedioUrl: {} as VedioUrl
        }
    },
    actions: {
        async getVedio(id: any) {
            let data = await getVedioUrl(id)
            // console.log(data)
            this.vedioUrl = data[0]
            this.vedioDetail = await getCloudMusic(id)
            this.allVedio = await getAllvideo(id)
        }
    },
    getters: {}
})

